
# list example
classmates=['Michael','Bob','Tracy']
print "classmates =",classmates

print "len(classmates) =",len(classmates)

print "classmates[0] =",classmates[0]
print "classmates[1] =",classmates[1]
print "classmates[2] =",classmates[2]

print "classmates[-1] =",classmates[-1]
print "classmates[-2] =",classmates[-2]
print "classmates[-3] =",classmates[-3]

classmates.append('Adm')
print "after classmates.append('Adm') =",classmates

classmates.insert(1,'Jack')
print "after classmates.insert(1,'Jack') =",classmates

print "classmates.pop() =",classmates.pop()
print "after classmates.pop() =",classmates

print "classmates.pop(1) =",classmates.pop(1)
print "after classmates.pop(1) =",classmates

L=['Apple',123,True]
print "new list L =",L

s=['python','Java',['asp','php'],'scheme']
print "new list s =",s
print "len(s) =",len(s)
print "s[2][1] =",s[2][1]

L=[]
print "empty list L =",L

print "---------------tuple--------------"

classmates=('Michael','Bob','Tracy')

print "tuple classmates=('Michael','Bob','Tracy') =",classmates

print "classmates[0] =",classmates[0]
print "classmates[1] =",classmates[1]
print "classmates[-1] =",classmates[-1]
print "classmates[-2] =",classmates[-2]

print "l=(1) --> l =",(1)
print "l=(1,) --> l =",(1,)

t=('a','b',['A','B'])
print "t =",t
t[2][0]='X'
t[2][1]='Y'
print "after t[2][0]='X' t[2][1]='Y'"
print "t =",t

